package lab02.test19;

import java.io.IOException;
import java.util.*;

public class Test19 {
    public static void main(String[] args) throws IOException {
        Scanner a = new Scanner(System.in);
        String str = a.nextLine();

        char[] arr = str.toCharArray();

        for (int i = str.length() - 1; i >= 0; i--) {
            if (arr[i] >= 97) {
                arr[i] -= 32;
                System.out.print(arr[i]);
            } else if (97 > arr[i]) {
                arr[i] += 32;
                System.out.print(arr[i]);
            }
        }
    }
}
